package com.bes.opslink.aiops.system.entity.user;

import com.bes.opslink.aiops.system.api.dto.user.UserDTO;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Mapper
public interface UserTransfer {

    UserTransfer transfer = Mappers.getMapper(UserTransfer.class);

    /**
     * PO转DTO
     *
     * @param user po对象
     * @return dto对象
     */
    @Mappings({})
    UserDTO toUserDTO(User user);

    /**
     * DTO转PO
     *
     * @param userDTO dto对象
     * @return po对象
     */
    @InheritConfiguration
    User toUser(UserDTO userDTO);
}
